.class public Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;
.super Ljava/lang/Object;
.source "VideoEditBGMPlayer.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;
    }
.end annotation


# instance fields
.field private a:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Les/cd$j;",
            ">;"
        }
    .end annotation
.end field

.field private b:Les/cd$j;

.field private c:Les/jb;

.field private d:Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;

.field private e:Les/jb$d;

.field private f:Les/cd;


# direct methods
.method public constructor <init>()V
    .locals 1

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 2
    sget-object v0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;->STOPED:Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;

    iput-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->d:Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;

    return-void
.end method

.method private a(J)J
    .locals 3

    .line 20
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->f:Les/cd;

    invoke-static {v0, p1, p2}, Les/rd;->b(Les/cd;J)J

    move-result-wide p1

    const-wide/16 v0, 0x0

    cmp-long v2, p1, v0

    if-gez v2, :cond_0

    move-wide p1, v0

    :cond_0
    return-wide p1
.end method

.method private a(Ljava/util/List;I)Les/cd$j;
    .locals 1
    .param p1    # Ljava/util/List;
        .annotation build Landroidx/annotation/NonNull;
        .end annotation
    .end param
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List<",
            "Les/cd$j;",
            ">;I)",
            "Les/cd$j;"
        }
    .end annotation

    .line 7
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->b:Les/cd$j;

    invoke-static {v0, p2}, Lcom/esfile/screen/recorder/videos/edit/player/a;->a(Les/cd$j;I)Z

    move-result v0

    if-nez v0, :cond_0

    .line 8
    invoke-static {p1, p2}, Lcom/esfile/screen/recorder/videos/edit/player/a;->a(Ljava/util/List;I)Les/cd$j;

    move-result-object p1

    goto :goto_0

    .line 9
    :cond_0
    iget-object p1, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->b:Les/cd$j;

    :goto_0
    return-object p1
.end method

.method static synthetic a(Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;)Les/jb$d;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->e:Les/jb$d;

    return-object p0
.end method

.method private a(Les/cd$j;)V
    .locals 5

    .line 10
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->c:Les/jb;

    if-eqz v0, :cond_0

    iget-object v1, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->d:Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;

    sget-object v2, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;->IDLE:Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;

    if-ne v1, v2, :cond_0

    .line 11
    iget-wide v1, p1, Les/cd$j;->d:J

    long-to-int v2, v1

    iget-wide v3, p1, Les/cd$j;->e:J

    long-to-int v1, v3

    invoke-virtual {v0, v2, v1}, Les/jb;->a(II)V

    .line 12
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->c:Les/jb;

    iget v1, p1, Les/cd$j;->h:F

    const/high16 v2, 0x40000000    # 2.0f

    div-float/2addr v1, v2

    invoke-virtual {v0, v1}, Les/jb;->a(F)V

    .line 13
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->c:Les/jb;

    iget-boolean p1, p1, Les/cd$j;->i:Z

    invoke-virtual {v0, p1}, Les/jb;->a(Z)V

    :cond_0
    return-void
.end method

.method private a(Ljava/lang/String;)V
    .locals 1

    .line 15
    new-instance v0, Les/jb;

    invoke-direct {v0}, Les/jb;-><init>()V

    iput-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->c:Les/jb;

    .line 16
    invoke-virtual {v0, p1}, Les/jb;->a(Ljava/lang/String;)V

    .line 17
    iget-object p1, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->c:Les/jb;

    new-instance v0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$a;

    invoke-direct {v0, p0}, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$a;-><init>(Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;)V

    invoke-virtual {p1, v0}, Les/jb;->a(Les/jb$d;)V

    .line 18
    sget-object p1, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;->IDLE:Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;

    iput-object p1, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->d:Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;

    return-void
.end method

.method private c(I)V
    .locals 1

    .line 1
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->a:Ljava/util/List;

    if-eqz v0, :cond_3

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    if-nez v0, :cond_0

    goto :goto_1

    .line 2
    :cond_0
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->a:Ljava/util/List;

    .line 3
    invoke-direct {p0, v0, p1}, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->a(Ljava/util/List;I)Les/cd$j;

    move-result-object p1

    .line 4
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->b:Les/cd$j;

    invoke-static {v0, p1}, Lcom/esfile/screen/recorder/videos/edit/player/a;->a(Les/cd$j;Les/cd$j;)Z

    move-result v0

    if-nez v0, :cond_2

    .line 5
    invoke-virtual {p0}, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->c()V

    if-eqz p1, :cond_2

    .line 6
    iget-object v0, p1, Les/cd$j;->b:Ljava/lang/String;

    if-eqz v0, :cond_2

    .line 7
    iput-object p1, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->b:Les/cd$j;

    .line 8
    iget-object p1, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->c:Les/jb;

    if-nez p1, :cond_2

    .line 9
    invoke-direct {p0, v0}, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->a(Ljava/lang/String;)V

    .line 10
    iget-object p1, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->b:Les/cd$j;

    invoke-direct {p0, p1}, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->a(Les/cd$j;)V

    .line 11
    iget-object p1, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->c:Les/jb;

    invoke-virtual {p1}, Les/jb;->d()Z

    move-result p1

    if-nez p1, :cond_1

    .line 12
    invoke-virtual {p0}, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->c()V

    goto :goto_0

    .line 13
    :cond_1
    sget-object p1, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;->PREPARED:Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;

    iput-object p1, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->d:Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;

    :cond_2
    :goto_0
    return-void

    .line 14
    :cond_3
    :goto_1
    invoke-virtual {p0}, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->c()V

    return-void
.end method

.method private d()V
    .locals 2

    .line 1
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->c:Les/jb;

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->d:Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;

    sget-object v1, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;->PREPARED:Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;

    if-eq v0, v1, :cond_0

    sget-object v1, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;->PAUSED:Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;

    if-ne v0, v1, :cond_1

    .line 2
    :cond_0
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->c:Les/jb;

    invoke-virtual {v0}, Les/jb;->e()V

    .line 3
    sget-object v0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;->PLAYING:Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;

    iput-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->d:Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;

    goto :goto_0

    :cond_1
    const-string v0, "VideoEditBGMPlayer"

    const-string v1, "BGMPlayer state is not PREPARED!"

    .line 4
    invoke-static {v0, v1}, Lcom/esfile/screen/recorder/utils/n;->d(Ljava/lang/String;Ljava/lang/String;)V

    :goto_0
    return-void
.end method


# virtual methods
.method public a(I)V
    .locals 0

    .line 5
    invoke-direct {p0, p1}, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->c(I)V

    .line 6
    invoke-direct {p0}, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->d()V

    return-void
.end method

.method public a(Les/cd;)V
    .locals 0

    .line 2
    iput-object p1, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->f:Les/cd;

    return-void
.end method

.method public a(Les/jb$d;)V
    .locals 0

    .line 19
    iput-object p1, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->e:Les/jb$d;

    return-void
.end method

.method public a(Ljava/util/List;)V
    .locals 0
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List<",
            "Les/cd$j;",
            ">;)V"
        }
    .end annotation

    .line 3
    iput-object p1, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->a:Ljava/util/List;

    const/4 p1, 0x0

    .line 4
    iput-object p1, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->b:Les/cd$j;

    return-void
.end method

.method public a()Z
    .locals 2

    .line 14
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->d:Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;

    sget-object v1, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;->PLAYING:Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;

    if-ne v0, v1, :cond_0

    const/4 v0, 0x1

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    :goto_0
    return v0
.end method

.method public b()V
    .locals 3

    .line 1
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->c:Les/jb;

    if-eqz v0, :cond_0

    iget-object v1, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->d:Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;

    sget-object v2, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;->PLAYING:Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;

    if-ne v1, v2, :cond_0

    .line 2
    invoke-virtual {v0}, Les/jb;->c()V

    .line 3
    sget-object v0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;->PAUSED:Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;

    iput-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->d:Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;

    goto :goto_0

    :cond_0
    const-string v0, "VideoEditBGMPlayer"

    const-string v1, "Failed to pause,BGMPlayer state is not PLAYING!"

    .line 4
    invoke-static {v0, v1}, Lcom/esfile/screen/recorder/utils/n;->d(Ljava/lang/String;Ljava/lang/String;)V

    :goto_0
    return-void
.end method

.method public b(I)V
    .locals 2

    .line 5
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->b:Les/cd$j;

    invoke-static {v0, p1}, Lcom/esfile/screen/recorder/videos/edit/player/a;->a(Les/cd$j;I)Z

    move-result v0

    if-nez v0, :cond_0

    .line 6
    invoke-direct {p0, p1}, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->c(I)V

    .line 7
    :cond_0
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->b:Les/cd$j;

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->c:Les/jb;

    if-eqz v0, :cond_1

    int-to-long v0, p1

    .line 8
    invoke-direct {p0, v0, v1}, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->a(J)J

    move-result-wide v0

    long-to-int p1, v0

    .line 9
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->b:Les/cd$j;

    iget-wide v0, v0, Les/cd$j;->f:J

    invoke-direct {p0, v0, v1}, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->a(J)J

    move-result-wide v0

    long-to-int v1, v0

    sub-int/2addr p1, v1

    .line 10
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->c:Les/jb;

    invoke-virtual {v0}, Les/jb;->c()V

    .line 11
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->c:Les/jb;

    invoke-virtual {v0, p1}, Les/jb;->a(I)I

    .line 12
    invoke-virtual {p0}, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->a()Z

    move-result p1

    if-eqz p1, :cond_2

    .line 13
    iget-object p1, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->c:Les/jb;

    invoke-virtual {p1}, Les/jb;->e()V

    goto :goto_0

    .line 14
    :cond_1
    invoke-virtual {p0}, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->c()V

    :cond_2
    :goto_0
    return-void
.end method

.method public c()V
    .locals 1

    .line 15
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->c:Les/jb;

    if-eqz v0, :cond_0

    .line 16
    invoke-virtual {v0}, Les/jb;->f()V

    .line 17
    :cond_0
    sget-object v0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;->STOPED:Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;

    iput-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->d:Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer$State;

    const/4 v0, 0x0

    .line 18
    iput-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->c:Les/jb;

    .line 19
    iput-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/player/VideoEditBGMPlayer;->b:Les/cd$j;

    return-void
.end method
